from api.utils import get_uuid, get_format_time, decrypt, download_img, current_timestamp, datetime_format
# from werkzeug.security import generate_password_hash, check_password_hash

from api.db.services.user_service import UserService

if __name__ == '__main__':
    a = "lf/Y/f1lHLJabZjYWYPgNlZ7A/4f7eAo3FyJGlTZt+NaB7siB76ThOaQrRgMtnxK2IVtZReCJhCOS1jGaxP/tUPJTnqq7a+lmQoWxGXoNzGbz5TNDhDdXSAVizsvZnw/Lkt3NgqDZW3oAO4zgK1GK9mP05fhNf6p9CNmXqyZgDFZbTLjgYj23cz7Jf+N9x698+Hp5QRwzhg6VhvBojq0GaA3gZmRrgjbLG8yy72zDFSg7zaF04huOityLYkl+qgjuQUPeBgyFOxd+hLofByhmVR01vdrH5KudcpnzTPEkzCyK2W8vmRbALN8iQg7SmtcRE11NuHN7xV6YeGSDdkOHg=="
    # password  = decrypt(a)
    # print(password)
    # res = generate_password_hash("YWRtaW4=")
    # print(res)

    login_channel = "password"
    email = "admin@ragflow.io"
    users = UserService.query(email=email)

    password = a
    password = decrypt(password)

    user = UserService.query_user(email, password)
    if user:
        response_data = user.to_json()
        user.access_token = get_uuid()


